/**
 * Get base Url
 * @returns {String}
 */
function getBaseUrl()
{
	var l = window.location;
	var base_url = l.protocol + "//" + l.host + "/" + l.pathname.split('/')[1];
	return base_url;
}
$(document).ready(function(){
	$('#btn_update').click(function(){
		var url = getBaseUrl()+'/index.php/settings/updatepreference';
		var values = $('#currency_form').serialize()+'&'+$('#distance_form').serialize()+'&'+$('#time_form').serialize()+'&'+$('#email_form').serialize();
		$('#spinter-update').show();
	    $.ajax({
	        url: url,
	        type: "POST",
	        data: values,
	        success: function(data){
	    	    $('#spinter-update').hide();
	        }
	    });
	});
});